package shiyan4;

public class Jisuan {
	
	public static double sum(double number1, double number2) throws Myexception {
		if (number1 < 0 || number2 < 0) {
			throw new Myexception("不可以使用负数");
		}
		return (number1 + number2);
	}

	public final static int x = 5000;
	public final static int y = 8000;

	public static double avg(double num) throws Myexception {

		if (num > x) {
			num = num * 0.97;
		}
		if (num > y) {
			num = num * 0.9;
		}
		if (num < x) {
			throw new Myexception("不需要交税");
		}
		return num;
	}

}